.TH FBC 1 "2024-03-24" "FreeBASIC Compiler 1.20.0" "FreeBASIC Compiler"
.SH NAME
fbc \- The FreeBASIC compiler
.SH DESCRIPTION
Compiles FreeBASIC source code files (*.bas) to native code.
.SH SYNOPSIS
.B fbc \fR[\fIoptions\fR] \fIinput-files\fR

.SH OPTIONS
.F
.TP
.I input-files\fR
\fB*.a\fR = library, \fB*.o\fR = object, \fB*.bas\fR = source, \fB*.rc\fR = win32 resource script, \fB*.res\fR = win32 compiled resource, \fB*.xpm\fR = X11 icon resource
.TP
\fB\@\fIfile\fR
Read more command line arguments from a file
.TP
\fB\-a\fR \fIfile\fR
Treat file as .o/.a input file
.TP
\fB\-arch\fR \fItype\fR
Set target architecture (default: \fB686\fR)
.TP
\fB\-asm\fR \fBatt\fR|\fBintel\fR
Set the assembler format for Asm blocks and for code generation (x86 only)
.TP
\fB\-b\fR \fIfile\fR
Treat file as .bas input file
.TP
\fB\-buildprefix\fR \fIname\fR
Specify prefix on tool names (as, ar, ld)
.TP
\fB\-c\fR
Compile only, do not link
.TP
\fB\-C\fR
Preserve temporary .o files
.TP
\fB\-d\fR \fIname\fR[\fB=\fIval\fR]
Add a global #define
.TP
\fB\-dll\fR
Same as \fB\-dylib\fR
.TP
\fB\-dylib\fR
Create a Win32 DLL or Linux/*BSD shared library
.TP
\fB\-e\fR
Enable runtime error checking
.TP
\fB\-earray\fR
Enable array bounds checking
.TP
\fB\-earraydims\fR
Enable array dimensions checking
.TP
\fB\-eassert\fR
Enable assert() and assertwarn() checking
.TP
\fB\-edebug\fR
Enable __FB_DEBUG__
.TP
\fB\-edebuginfo\fR
Add debug information
.TP
\fB\-elocation\fR
Enable full error location reporting
.TP
\fB\-enullptr\fR
Enable null-pointer checking
.TP
\fB\-eunwind\fR
Enable call stack unwind information
.TP
\fB\-entry\fR \fIname\fR
Change the entry point of the program from main()
.TP
\fB\-ex\fR
\fB-e\fR plus RESUME support
.TP
\fB\-exx\fR
\fB-ex\fR plus array bounds/null-pointer checking
.TP
\fB\-export\fR
Export symbols for dynamic linkage
.TP
\fB\-fbgfx\fR
Link to the appropriate libfbgfx variant (normally automatic)
.TP
\fB\-forcelang\fR \fIname\fR
Override #lang statements in source code
.TP
\fB\-fpmode\fR \fBfast\fR|\fBprecise\fR
Select floating-point math accuracy/speed
.TP
\fB\-fpu\fR \fBx87\fR|\fBsse\fR|\fneon\fR
Set target FPU
.TP
\fB\-g\fR
Add debug info, enable __FB_DEBUG__, and enable asserts
.TP
\fB\-gen\fR \fIbackend\fR
Select code generation backend (gas|gas64|gcc|llvm|clang)
.TP
\fB\-gen clang\fR       Select clang C backend
\fB\-gen gas\fR     Select GNU gas 32-bit assembler backend
\fB\-gen gas64\fR       Select GNU gas 64-bit assembler backend
\fB\-gen gcc\fR         Select GNU gcc C backend
\fB\-gen llvm\fR        Select LLVM backend
.TP
\fB\-help\fR, \fB\--help\fR
Show help output; use '-help -v' to show verbose help
.TP
\fB\-i\fR \fIpath\fR
Add an include file search path
.TP
\fB\-include\fR \fIfile\fR
Pre-#include a file for each input .bas
.TP
\fB\-l\fR \fIname\fR
Link in a library
.TP
\fB\-lang\fR \fIname\fR
Select FB dialect: \fBfb\fR (default), \fBdeprecated\fR, \fBqb\fR, \fBfblite\fR
.TP
\fB\-lib\fR
Create a static library
.TP
\fB\-m\fR \fIname\fR
Set main module (default if not -c: first input .bas)
.TP
\fB\-map\fR \fIfile\fR
Save linking map to file
.TP
\fB\-maxerr\fR \fIn\fR
Only show \fIn\fR errors
.TP
\fB\-mt\fR
Use thread-safe FB runtime
.TP
\fB\-nodeflibs\fR
Do not include the default libraries when linking
.TP
\fB\-noerrline\fR
Do not show source context in error messages
.TP
\fB\-nolib\fR \fIa,b,c\fR
Do not include the specified libraries when linking
.TP
\fB\-noobjinfo\fR
Do not read/write compile-time info from/to .o and .a files
.TP
\fB\-nostrip\fR
Do not strip symbol information from the output file
.TP
\fB\-o\fR \fIfile\fR
Set .o file name for corresponding input .bas
.TP
\fB\-O\fR \fIvalue\fR
Optimization level (default: 0)
.TP
\fB\-p\fR \fIpath\fR
Add a library search path
.TP
\fB\-pic\fR
Generate position-independent code (non-x86 Unix shared libs)
.TP
\fB\-pp\fR
Write out preprocessed input file (.pp.bas) only
.TP
\fB\-prefix\fR \fIpath\fR
Set the compiler prefix path
.TP
\fB\-print\fR \fBhost\fR|\fBtarget\fR
Display host/target system name
.TP
\fB\-print\fR \fBlibfbdir\fR  
Display the compiler's lib/ path
.TP
\fB\-print\fR \fBx\fR
Display output binary/library file name (if known)
.TP
\fB\-print\fR \fBsha-1\fR
Display compiler's source code commit sha-1 (if known)
.TP
\fB\-print\fR \fBfork-id\fR
Display compiler's fork identifier (if set)
.TP
\fB\-profgen\fR
Set the profiling code generation type (gmon|fb)
\fB\-profile\fR
Enable function profiling
.TP
\fB\-r\fR
Write out .asm (-gen gas) or .c (-gen gcc) only
.TP
\fB\-rr\fR
Write out the final .asm only
.TP
\fB\-R\fR
Preserve the temporary .asm/.c file
.TP
\fB\-RR\fR
Preserve the final .asm file
.TP
\fB\-s\fR \fBconsole\fR|\fBgui\fR
Select win32 subsystem
.TP
\fB\-static\fR
Prefer static libraries over dynamic ones when linking
.TP
\fB\-strip\fR
Omit all symbol information from the output file
.TP
\fB\-sysroot\fR \fIpath\fR
Tell the linker the root path of where to find libraries (needed by some toolchains)
.TP
\fB\-t\fR \fIvalue\fR
Set Win32/DOS .exe stack size in kbytes, default: 1024
.TP
\fB\-target\fR \fIname\fR
Set cross-compilation target
.TP
\fB\-title\fR \fIname\fR
Set XBE display title (XBox)
.TP
\fB\-v\fR
Be verbose
.TP
\fB\-vec \fIn\fR
Automatic vectorization level (default: 0)
.TP
\fB\-version\fR, \fB\--version\fR
Show compiler version
.TP
\fB\-w\fR \fBall\fR|\fBpedantic\fR|\fIn\fR
Set minimum warning level: \fBall\fR, \fBpedantic\fR, or an integer
.TP
\fB\-w\fR \fBall\fR
Enable all warnings
.TP
\fB\-w\fR \fBnone\fR
Disable all warnings
.TP
\fB\-w\fR \fBparam\fR
Enable parameter warnings
.TP
\fB\-w\fR \fBescape\fR
Enable string escape sequence warnings
.TP
\fB\-w\fR \fBnext\fR
Enable next statement warnings
.TP
\fB\-w\fR \fBsignedness\fR
Enable type signedness warnings
.TP
\fB\-w\fR \fBconstness\fR
Enable const type warnings
.TP
\fB\-w\fR \fBsuffix\fR
Enable warning when up-casting discards initializers
.TP
\fB\-w\fR \fBerror\fR
Report warnings as errors
.TP
\fB\-w\fR \fBupcast\fR
Warn when up-casting discards initializers
.TP
\fB\-Wa\fR \fIa,b,c\fR
Pass options to GAS
.TP
\fB\-Wc\fR \fIa,b,c\fR
Pass options to GCC (with -gen gcc)
.TP
\fB\-Wl\fR \fIa,b,c\fR
Pass options to LD
.TP
\fB\-x \fIfile\fR
Set output executable/library file name
.TP
\fB\-z fbrt\fR
Link with 'fbrt' instead of 'fb' runtime library
.TP
\fB\-z gosub-setjmp\fR
Use setjmp/longjmp to implement GOSUB
.TP
\fB\-z no-fastcall\fR
Don't use '__fastcall' calling convention
.TP
\fB\-z no-thiscall\fR
Don't use '__thiscall' calling convention
.TP
\fB\-z nobuiltins\fR
Disable all non-required builtin procedure definitions
.TP
\fB\-z nocmdline\fR
Disable #cmdline source directives
.TP
\fB\-z retinflts\fR
Enable returning some types in floating point registers
.TP
\fB\-z valist-as-ptr\fR
Use pointer expressions to implement CVA_*() macros

.SH ENVIRONMENT
.IP AS
Overrides location of GNU as (assembler)
.IP AR
Overrides location of GNU ar (archiver)
.IP LD
Overrides location of GNU ld (linker)
.IP GCC
Overrides location of gcc (compiler, -gen gcc)
.IP LLC
Overrides location of llc (compiler, -gen llvm)
.IP CLANG
Overrides location of clang (compiler, -gen clang)
.IP DLLTOOL
Overrides location of dlltool (import library, -target win32|cygwin)
.IP GORC
Overrides location of gorc (resource compiler, on standalone win32 host version only
.IP WINDRES
Overrides location of windres (resource compiler)
.IP CXBE
Overrides location of cxbe (executable convertor, -target xbox)
.IP DXEGEN
Overrides location of dxe3gen (-target dos)
.IP EMAS
Overrides location of emas (-target js-asmjs)
.IP EMAR
Overrides location of emar (-target js-asmjs)
.IP EMCC
Overrides location of emcc (-target js-asmjs)
.IP EMLD
Overrides location of emld (-target js-asmjs)

.SH "SEE ALSO"
The full language specification and help is available in wiki format at
.B 
https://www.freebasic.net/wiki/
.SH COPYRIGHT
Copyright \(co 2004\-2024 The FreeBASIC Development Team
.br
This is free software.  You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.
.SH BUGS
Any bugs should be reported on the Sourceforge.net tracker located at https://www.sourceforge.net/projects/fbc/

.SH AUTHOR
This manpage written by Ebben Feagan (ebben.feagan@gmail.com)
